package com.zjl.SpringBoot.第21章_流式_响应式_编程.C_Reactive响应式核心;

import org.junit.Test;
import reactor.core.publisher.Flux;

import java.io.IOException;

/**
 * ClassName: D2_Reactor实现之_Flux高级
 * Package: com.zjl.SpringBoot.第21章_流式_响应式_编程.C_Reactive响应式核心
 * Description:
 *
 * @Author 张蛟龙
 * @Create 2025/3/19 20:44
 * @Version 1.0
 */
public class D2_Flux高级之日志 {
    @Test
    public void Flux响应式日志() throws IOException {

        //合并流
//        Flux.concat(Flux.just(1, 3, 5, 7), Flux.just(2, 4, 6))
        Flux.range(1,10)
                .filter(i -> i >5)//过滤
                .log()
                .map(i -> i * 10)
                .subscribe(System.out::println);

        try { Thread.sleep(1000); } catch (InterruptedException e) { throw new RuntimeException(e); }

    }

}
